package widget

type Item struct {
	ID   int
	Name string
}

type TableModel struct {
	Items []Item
}

func (m *TableModel) RowCount() int {
	return len(m.Items)
}

func (m *TableModel) Value(row, col int) interface{} {
	if row < 0 || row >= len(m.Items) {
		return nil
	}
	switch col {
	case 0:
		return m.Items[row].ID
	case 1:
		return m.Items[row].Name
	}
	return nil
}
